package net.myjung.spring;

import java.util.ArrayList;
import java.util.List;

import net.myjung.model.BaseObject;
import net.myjung.model.annotation.MdlClass;
import net.myjung.model.annotation.MdlElement;
import net.myjung.model.annotation.MdlField;

@MdlClass(name = "Map")
@SuppressWarnings("serial")
public class SprMap extends BaseObject {
	@MdlField(type = "net.myjung.spring.SprProperty")
	private SprProperty _parent;
	@MdlElement(singular = "entry", type = "net.myjung.spring.Entry")
	private List<SprEntry> entries;

	public SprProperty get_parent() {
		return _parent;
	}
	public void set_parent(SprProperty _parent) {
		this._parent = _parent;
	}
	public List<SprEntry> getEntries() {
		return entries;
	}
	public void setEntries(List<SprEntry> entries) {
		this.entries = entries;
	}
	public void addEntry(SprEntry entry) {
		if (this.entries == null)
			this.entries = new ArrayList<SprEntry>();
		this.entries.add(entry);
	}
	public void removeEntry(SprEntry entry) {
		if (this.entries == null || !this.entries.contains(entry))
			return;
		this.entries.remove(entry);
	}
}